package club.kingyin.commons.entity.core;

import club.kingyin.commons.enums.BlogEnum;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;

import java.io.Serializable;

/**
 * (Comment)表实体类
 *
 * @author makejava
 * @since 2022-02-16 18:14:06
 */
@Data
@SuppressWarnings("serial")
public class Comment extends Model<Comment> {
    //ID
    @TableId(type = IdType.AUTO)
    private Integer id;
    //内容
    private String content;
    //评论时间
    private Long timestamp;
    //状态
    private BlogEnum status;
    //被评论对象
    private Integer objectid;
    //评论用户ID
    private Integer userid;
    //主评论ID
    private Integer parentid;
    //回复用户id
    private Integer replaceid;
    // 子评论数
    private Integer size;


    /**
     * 获取主键值
     *
     * @return 主键值
     */
    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}

